package com.tm.exception;

import com.tm.enums.StatusCodeEnum;

/**
 * @author huangp
 * @create 2023-03-01 12:51
 */
public class BizException extends RuntimeException{

    private Integer code;

    private String message;

    public BizException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizException(StatusCodeEnum statusCodeEnum) {
        this.code = statusCodeEnum.getCode();
        this.message = statusCodeEnum.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }



}
